package attr

import (
	"gddgame.cc/galaxy/common/dsl/game"
)

const providerName = "attr"

func init() {
	_ = game.RegisterGlobalModule(game.ModuleProvider{
		Name: providerName,

		OnInit: func(env *game.Environment) error {
			var err error
			if table, err := env.RegisterModel(SettingAttrName, &SettingAttr{}); err != nil {
				return err
			} else {
				table.Sort = "sort"
			}
			if _, err = env.RegisterModel(SettingAttrGroupName, &SettingAttrGroup{}); err != nil {
				return err
			}
			return nil
		},
	})
}
